﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Serialization;

// For more information on enabling Web API for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860

namespace Sino.CapacityCloud.Web
{
    public class rolesResponse
    {
        public string Error { get; set; }
        public IEnumerable<Roles> Response { get; set; }
    }
    

    public class Roles
    {
        public string Id { get; set; }
        public string Name { get; set; }
    }
    public class RolesController : Controller
    {
        [HttpGet("roles")]
        public IActionResult roles()
        {
            var response = new rolesResponse()
            {
                Error = null,
                Response = new List<Roles>()
                {
                    new Roles() { Id="05ba9048-c970-4584-90af-054199a0c854",Name="Carrier"},
                    new Roles() { Id="097b8b68-3e42-45b1-a8fb-e6c8685077dd",Name="Staff"} ,
                    new Roles() { Id="508d6572-24ba-4076-885b-1babd9bc6f5c",Name="Administator"},
                    new Roles() { Id="e7fdeff6-30c7-4fb6-af7b-ea4e5a6dc9bf",Name="Driver"},
                    new Roles() { Id="508d6572-24ba-4076-885b-1babd9bc6f5c",Name="System" }
                }
            };

            return Json(response, new Newtonsoft.Json.JsonSerializerSettings() { ContractResolver = new DefaultContractResolver() });
        }
    }
}
